package com.hyperf.event.client;

/**
 * @author lizhaoyang
 */
public class EventFactory {

    /**
     * 工厂实现类实例. 单例模式.
     */
    private static EventFactoryApi eventFactory = null;

    static {
        try {
            Class<?> factoryClass = EventFactory.class.getClassLoader()
                            .loadClass("com.hyperf.event.client.impl.EventFactoryApiImpl");
            eventFactory = (EventFactoryApi) factoryClass.newInstance();
        } catch (Throwable e) {
            e.printStackTrace();
        }
    }

    public static EventListenerService createEventListenerService() {
        return eventFactory.createEventListenerService();
    }
}
